const express = require("express");
const bodyParser = require("body-parser");
const app = express();
app.use(bodyParser.json());
app.post("/",(req,res)=>{
    console.log(req.body);
    req.body.result = "调用成功！";
    res.json(req.body);
});
var data = {
    name : "王五",
    gender : [
      { name : "男" , value:"0" , checked:false},
      { name : "女" , value:"1" , checked:true}
    ],
    skills : [
      { name : "HTML",value : "html",checked:true },
      { name : "CSS",value : "css",checked:false },
      { name : "JavaScript",value : "js",checked:true },
      { name : "PhotoShop",value : "ps",checked:false }
    ],
    opinion : "测试123"
};
app.get("/",(req,res) => {
    console.log(req.headers);
    res.json(data);
});
app.listen(3000,()=>{
    console.log("Server is running at http://172.16.26.249:3000");
});